package com.wharf.base.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.wharf.base.model.GoodsType;
import com.wharf.base.service.GoodsInfoService;

@RestController
@RequestMapping("/back")
public class TypeController {
	@Autowired
	private GoodsInfoService goodsService;
	
	//
	@ResponseBody
	@GetMapping("/typeshow")
	public ResponseEntity<List<GoodsType>> showAll(){
		List<GoodsType> list = goodsService.typeShow();
		return new ResponseEntity<List<GoodsType>>(list,HttpStatus.OK);
	}
	
	@GetMapping("/typedele")
	public boolean delAction(Integer id) {
		boolean delById = goodsService.delById(id);
		return delById;
	}
}
